from car import Car

class Battery:
    """一次模拟电动汽车电池的简单尝试"""
    def __init__(self,battery_size = 40):
        """初始化电池属性"""
        self.battery_size = battery_size

    def describe_battery(self):
        """打印一条描述电池容量的消息"""
        print(f"This car has a {self.battery_size}-kWh battery")

    def get_range(self):
        """打印信息指出电池续航里程"""
        if self.battery_size == 40:
            range = 150
        elif self.battery_size == 65:
            range = 225
        print(f"This car can go about {range} miles on a full charge")

class ElectricCar(Car):
    """电动车独特之处"""
    def __init__(self,make,model,year):
        super().__init__(make,model,year)
        self.battery = Battery()